<?php 
//引入PDO操作类
include('PDOMethod.php');
//实例化对象
$pdo = new PDOMethod('mysql','127.0.0.1','exam','root','root');
//调用查询方法
$data = $pdo->getData('car');
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<h2 align="center">购物车</h2>
	<!-- 遍历输出 -->
	<?php foreach ($data as $key => $value): ?>
		<div style="margin-left: 600px; margin-top: 20px;" >
			<img src="images/<?php echo $value['car_image']?>" width=100 alt="">
			<span style="vertical-align: top; display: inline-block; width: 280px;"><?php echo $value['car_name'] ?><br><b style="color:red"><?php echo $value['car_price'] ?></b><br><span>库存： <?php echo $value['car_num'] ?></span></span>
		</div>

	<?php endforeach ?>
	
</body>
</html>